package com.seex.motor;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.widget.Toast;

public class TestService extends Service {
    private Motor motor;
    public TestService() {
    }

    @Override
    public IBinder onBind(Intent intent) {
        // TODO: Return the communication channel to the service.
        throw new UnsupportedOperationException("Not yet implemented");
    }

    @Override
    public void onCreate() {
        super.onCreate();
        Toast.makeText(this,"后台服务启动",Toast.LENGTH_SHORT).show();
        motor=new Motor();
        motor.open();
        motor.startCycleRun();

    }

    @Override
    public void onDestroy() {
        Toast.makeText(this,"后台服务STOP",Toast.LENGTH_SHORT).show();
        motor.close();
        super.onDestroy();

    }
}
